package com.test;

import java.util.List;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import com.tiaoshi.thenwhat.common.entity.common.Person;
import com.tiaoshi.thenwhat.common.service.MyService;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration   
({"classpath:systemProperties/applicationContext*.xml"})
public class UserInit {
	
	@Autowired
	MyService myService;;
	
	
	/**
	 * 生成用户的邀请码到优惠码页面
	 */
	@Test   //标明是测试方法  
    public void testMongoDb(){
		myService.doWork();
	}
	
	/**
	 * 生成用户的邀请码到优惠码页面
	 */
	@Test   //标明是测试方法  
    public void getList(){
		List<Person> list = myService.getList();
		System.out.println(list.size());
	}
	
	@Test   //标明是测试方法  
    public void getDetail(){
		String id = "562dbc69d4c68ec1445b470b";
		Person person = (Person)myService.getById(id);
		System.out.println(person.getFirstname());
	}
}
